package edu.ccut.saturn.studio.naviagtor.actions;

import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.PlatformUI;

import edu.ccut.saturn.studio.Activator;
import edu.ccut.saturn.studio.Images;
import edu.ccut.saturn.studio.component.wizard.ComponentWizard;
import edu.ccut.saturn.studio.core.util.action.SaturnAction;
import edu.ccut.saturn.studio.core.util.eclipse.Messages;

/**
 * 
 * @author Bai Yucheng 2007-11-02
 */
public class NewSaturnComponentAction extends SaturnAction {

	public NewSaturnComponentAction() {
		setText(Messages.getString("NewSaturnComponentAction.compontent")); //$NON-NLS-1$
		setImageDescriptor(Activator
				.getImageDescriptor(Images.NEWSATURN_COMPONENT_ACTION));
	}

	public void run() {
		ComponentWizard newComponentWizard = new ComponentWizard();
		newComponentWizard
				.init(PlatformUI.getWorkbench(), super.getStructuredSelection());
		WizardDialog wizarddialog = new WizardDialog(PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getShell(), newComponentWizard);
		wizarddialog.open();
	}

}
